import 'dart:typed_data';

import 'package:flutter_test/flutter_test.dart';
import 'package:fast_image_compress/fast_image_compress.dart';
import 'package:fast_image_compress/fast_image_compress_platform_interface.dart'
    as platform_interface;
import 'package:fast_image_compress/fast_image_compress_method_channel.dart'
    as method_channel;
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFastImageCompressPlatform with MockPlatformInterfaceMixin
    implements FastImageCompressPlatform  {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<Uint8List?> compressImage(Uint8List imageData, int? targetWidth, int compressionQuality, String imageQuality) {
    // TODO: implement compressImage
    throw UnimplementedError();
  }

  @override
  Future<Uint8List?> pickImage() {
    // TODO: implement pickImage
    throw UnimplementedError();
  }

  @override
  Future<List<Uint8List>?> pickMultiImage({int limit = 30}) {
    // TODO: implement pickMultiImage
    throw UnimplementedError();
  }
}

void main() {
  final FastImageCompressPlatform initialPlatform =
      FastImageCompressPlatform.instance;

  test(
      '${method_channel.MethodChannelFastImageCompress} is the default instance',
      () {
    expect(initialPlatform, isInstanceOf<MethodChannelFastImageCompress>());
  });

  test('getPlatformVersion', () async {

    MockFastImageCompressPlatform fakePlatform =
        MockFastImageCompressPlatform();
    FastImageCompressPlatform.instance = fakePlatform;

    expect(await FastImageCompressPlatform.instance.getPlatformVersion(), '42');
  });
}
